#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "MessageEvent.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Operation;

/// <summary>
/// CallEvent
/// A CallEvent models the receipt by an object of a message invoking a call of an
/// Operation.
/// </summary>
class UMLMODEL_EXPORT CallEvent : public MessageEvent {

public: // Constructors and destructors
    explicit CallEvent(const QString& umlType="uml::CallEvent");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// operation getter
    /// Designates the Operation whose invocation raised the CalEvent.
    /// </summary>
    shared_ptr<Operation> operation() const;

    /// <summary>
    /// operation setter
    /// Designates the Operation whose invocation raised the CalEvent.
    /// </summary>
    void setOperation(shared_ptr<Operation> value);

private: // Fields
    /// <summary>
    /// operation
    /// Designates the Operation whose invocation raised the CalEvent.
    /// </summary>
    shared_ptr<Operation> operation_;

};

} // namespace uml
